<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户设置页面</title>
<style type="text/css">
	[data-type='setting-item'] {
		display: none;
	}
</style>
</head>
<lui:context/>
<u:View basePath="/res-system/setting" userJS="userSetting" delayLoadJs="false">
<body>
    <lui:dialogBody>
        <form class="m-cust m-narrow" id='userSettingFrm'>
        	<div class="form-group m-narrow row" data-key="automenu" data-type="setting-item">
			    <div class="col-xs-12">
			        <div class="col-xs-3">
			            <label class='m-label m-float-right' for="automenu">自动打开的菜单：</label>
			        </div>
			        <div class="col-xs-8">
			            <textarea class='m-input form-control' id='automenu' rows="3" min="0" disabled="disabled"></textarea>
			            <input name="settingValue" id='automenuValue' hidden="hidden">
			        </div>
			        <div class="col-xs-1">
			        	<a href="javascript:void(0)" onclick="UserSettingPage.openSelectMenusPage()" class="m-float-left"><i class="fa fa-fw fa-edit"></i></a>
			        </div>
			    </div>
			    <input name="settingKey" value='automenu' hidden="hidden">
			    <input name="valueType" value="02" hidden="hidden">
			    <lui:ajax id="getTreeShapeResourceNamesAjax" url="${ctx }/sys/menu/getTreeShapeResourceNames" onSuccess="UserSettingPage.onGetNameSucc"
			    	type="post" contentType="application/x-www-form-urlencoded" autoSend="false" silent="true"/>
			</div>
			<!-- 保存用户设置 -->
			<lui:ajax id="saveAllUserSettingAjax" url="${ctx }/setting/save/all" onSuccess="UserSettingPage.onSaveAllSucc" type="post" 
				contentType="application/json"/>
			<!-- 查询用户的所有settingKey -->
			<lui:ajax url="${ctx }/setting/find/current/settingKeys" id="findCurrentRoleSettingKeysAjax" 
				onSuccess="UserSettingPage.findCurrentRoleSettingKeysSucc" autoSend="true"/>
			<!-- 查询用户的设置信息 -->
			<lui:ajax url="${ctx }/setting/find/all" id="findAllSettingsAjax" 
				onSuccess="UserSettingPage.findAllSettingsSucc" />
        </form>
    </lui:dialogBody>
    <lui:dialogFooter>
       <button class="btn btn-primary m-btn" type="button" onclick="UserSettingPage.save()">保存</button>
       <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box">关闭</button>
    </lui:dialogFooter>
</body>
</u:View>
</html>